<?php
/**
 * Mapper allowing to manage service versions in database table.
 * 
 * @author Damian Sromek <damianpaq@gmail.com>
 * @version 0.1
 */
// TODO: comment
class Plus_Model_News_Mapper extends Plus_Model_Mapper_DbTable_Abstract
{	
	
	/**
	 * Constructor
	 * 
	 * @return void
	 */
	protected function __construct()
	{
		$options = array(
			'supportedModelClassName' 	=> 'Plus_Model_News_News',
			'dbTable' 					=> new Plus_Model_News_DbTable()
		);
		
		parent::__construct($options);
	}
	
	// we want this mapper had only once instance
	public static function factory()
	{
		$className = __CLASS__;
		
		if (!self::hasInstance($className)) {
			self::setInstance($className, new $className());
		}
		
		return self::getInstance($className);
	}
}